package com.woniuxy.light_smart.controller;

import com.woniuxy.light_smart.entity.HandleStatus;
import com.woniuxy.light_smart.service.HandleService;
import com.woniuxy.light_smart.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("handle")
@RestController
public class HandleController {
    @Autowired
    private HandleService handleService;
    @GetMapping("")
    public Result sell(){
        List<HandleStatus> handleList = handleService.selectAll();
        if(handleList!=null){
            return Result.ok().data("list",handleList);
        }else {
            return Result.error();
        }
    }
}
